<!doctype html>
<html>
<head>
    <meta charset="UTF-8">
    <title>Document</title>
 <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">   
<link rel="stylesheet" href="../../../../assets/css/reset.css"/>

    <link rel="stylesheet" href="../../../../assets/css/examples.css"/>

</head>
<body>
<h1>
    Data
</h1>

<ul>
    <li>

        <a href="javascript:void(0)" id="selectBankOfDeposit">选择开户行</a>
    </li>
    <li>
        <a href="javascript:void(0)" id="selectBankOfCity">选择开户城市无历史数据</a>
    </li>
    <li>
        <a href="javascript:void(0)" id="selectBankOfCityHistory">选择开户城市有历史数据</a>
    </li>
    <li>
        <a href="javascript:void(0)" id="selectBranch">选择支行</a>
    </li>
</ul>

<div style="height: 1000px;display: none;" id="scrollEl"></div>
<script  src="../../../../../core/$$.js"></script>
<script  src="../../../../../core/libs/zepto/zepto.min.js"></script>
<script  src="../../../../../core/libs/zepto/selector.js"></script>
<script  src="../../../../../core/libs/zepto/touch.js"></script>
<script  src="../../../../../core/libs/underscore-min.js"></script>
<script  src="../../../../../core/libs/oop.js"></script>
<script  src="../../../../../core/extend/prototype.js"></script>
<script  src="../../../../../core/extend/function.js"></script>
<script  src="../../../../../core/native/platformAdapter.js"></script>
<script  src="../../../../../core/native/api.js"></script>
<script  src="../../../../../core/native/eventListener.js"></script>
<script  src="../../../classes/XX.js"></script>
<script  src="../../../classes/common.js"></script>
<script  src="../../../../config/url/dev.js"></script>

<script type="text/javascript">


    var listData = [{Value: "001", Name: "上海"},{Value: "002", Name: "深圳"},{Value: "003", Name: "北京"},{Value: "004", Name: "广州"},{Value: "005", Name: "台州"}];


    $('#selectBankOfDeposit').on('tap', function () {
        console.log(listData);
        $$.Native.selectBankOfDeposit({
            list:listData,
            callback : function(data){
                $$.Native.alert({text:("Value:"+ data.Value + " Name:" + data.Name)});
            }
        });
    });

var historyList,cityList;
 var historyList = [{
        province: {Vaule: "6001", Name: "上海市"},
         city: {Vaule: "6001", Name: "上海"}
        },{
        province: {Vaule: "7000", Name: "江苏"},
         city: {Vaule: "7001", Name: "台州"}
        }
    ],
    cityList = [
    {
        province: {Vaule: "1000", Name: "河北"}, 
        citys: [
            {Vaule: "1001", Name: "石家庄"},
            {Vaule: "1002", Name: "保定市"},
            {Vaule: "1003", Name: "秦皇岛"},
            {Vaule: "1004", Name: "唐山市"},
            {Vaule: "1005", Name: "邯郸市"},
            {Vaule: "1006", Name: "邢台市"},
            {Vaule: "1007", Name: "沧州市"},
            {Vaule: "1008", Name: "承德市"},
            {Vaule: "1009", Name: "廊坊市"},
            {Vaule: "1010", Name: "衡水市"},
            {Vaule: "1011", Name: "张家口"}
        ]    
        },  
        {
            province: {Vaule: "2000", Name: "四川省"}, 
            citys: [
            {Vaule: "2001", Name: "乐山市"},
            {Vaule: "2002", Name: "雅安市"},
            {Vaule: "2003", Name: "广安市"},
            {Vaule: "2004", Name: "南充市"},
            {Vaule: "2005", Name: "自贡市"},
            {Vaule: "2006", Name: "泸州市"},
            {Vaule: "2007", Name: "内江市"},
            {Vaule: "2008", Name: "宜宾市"},
            {Vaule: "2009", Name: "广元市"},
            {Vaule: "2010", Name: "达州市"},
            {Vaule: "2011", Name: "资阳市"},
            {Vaule: "2012", Name: "绵阳市"},
            {Vaule: "2013", Name: "眉山市"},
            {Vaule: "2014", Name: "巴中市"},
            {Vaule: "2015", Name: "攀枝花"},
            {Vaule: "2016", Name: "遂宁市"},
            {Vaule: "2017", Name: "德阳市"}
            ] 
        }
    ];

    cityList = [{province: {Name:"广东",value:"0001"}, citys: [{Name:"广州",value:"88106"}, {Name:"广州",value:"88106"}]}];
    $('#selectBankOfCity').on('tap', function () {
        console.log(cityList);
        $$.Native.selectBankOfCity({
            historyList:[],
            cityList:cityList,
            callback : function(data){
                $$.Native.alert({text:(" Name:" + data.Name + "Vaule:" + data.Vaule)});
            }
        });
    });
    $('#selectBankOfCityHistory').on('tap', function () {
         console.log(historyList);
        console.log(cityList);
        $$.Native.selectBankOfCity({
            historyList:historyList,
            cityList:cityList,
            callback : function(data){
                $$.Native.alert({text:(" Name:" + data.Name +"Vaule" + data.Vaule)});
            }
        });
    });
    var city,list;
    city = "深圳";
    list = [
        {Vaule: '01', Name: '龙岗支行'},
        {Vaule: '02', Name: '宝安支行'},
        {Vaule: '03', Name: '福田支行'},
        {Vaule: '04', Name: '罗湖支行'},
        {Vaule: '05', Name: '盐田支行'}
    ];
    $('#selectBranch').on('tap', function () {
        console.log(city);
        console.log(list);
        $$.Native.selectBranch({
            city:city,
            list:list,
            callback : function(data){
                $$.Native.alert({text:("Value:"+ data.Value + " Name:" + data.Name)});
            }
        });
    });


</script>
</body>
</html>